-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-2364 Replace deprecated dns.resolver.query with dns.resolver.resolve #598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks like I'm unable to see the details of why the evergreen test failed without creating an account. 😞 |
ShaneHarvey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking this on!
test/test_client.py
Outdated
| from pymongo.srv_resolver import resolver | ||
| patched_resolver = FunctionCallRecorder(resolver.query) | ||
| pymongo.srv_resolver.resolver.query = patched_resolver | ||
| patched_resolver = FunctionCallRecorder(resolver.resolve) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be updated now that we use pymongo.srv_resolver._resolve instead of pymongo.srv_resolver.resolver.resolve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if I did this correctly.
ShaneHarvey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks @janosh!
Fixes the following deprecation warning:
/home/jr769/miniconda3/envs/py38/lib/python3.8/site-packages/pymongo/srv_resolver.py:72: DeprecationWarning: please use dns.resolver.resolve() instead results = resolver.query('_mongodb._tcp.' + self.__fqdn, 'SRV', /home/jr769/miniconda3/envs/py38/lib/python3.8/site-packages/pymongo/srv_resolver.py:57: DeprecationWarning: please use dns.resolver.resolve() instead results = resolver.query(self.__fqdn, 'TXT',